﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KidsWiththeGreatestNumberofCandies
{
    public class Solution
    {
        public IList<bool> KidsWithCandies(int[] candies, int extraCandies)
        {
            //int maxCandies = candies.Max();
            //List<bool> isGreatNumbers = new List<bool>();
            //foreach (var item in candies)
            //{
            //    if (item + extraCandies >= maxCandies)
            //        isGreatNumbers.Add(true);
            //    else
            //        isGreatNumbers.Add(false);
            //}

            //return isGreatNumbers;

            return candies.Select(i => i + extraCandies >= candies.Max() ? true : false).ToList();
        }
    }
}
